print("冒泡排序")
def maopao(nums:list[int])->list[int]:
    for i in range(0,len(nums)):
        for j in range(0,len(nums)-1-i):
            if nums[j+1]>nums[j]:
                nums[j+1],nums[j]=nums[j],nums[j+1]
    print(nums)
    return nums


print("插入排序")
def charupaixu(nums:list[int])->list[int]:
    for index in range(1,len(nums)):
        j=index
        while nums[j-1]<nums[j] and j>0:
            nums[j-1],nums[j] = nums[j],nums[j-1]
            j=j-1
    print(nums)
    return nums

def xuanzepaixu(nums:list[int]) ->list[int]:
    current_index=0
    while current_index <len(nums)-1:
        min_index=current_index
        for index in range(current_index,len(nums)):
            if nums[min_index]>nums[index]:
                min_index=index
        nums[current_index],nums[min_index]=nums[min_index],nums[current_index]
        current_index=current_index+1
    print(nums)
    return nums


if __name__ == '__main__':
    source_list=[1,2,4,5,7,23,3,1,2,5,3]
    # maopao(source_list)
    # charupaixu(source_list)
    xuanzepaixu(source_list)